package circuits;

import java.util.Iterator;

public class OrOperator extends Operator {

	@Override
	protected void calculateResult() {
		Iterator<Operation> operandsIterator = this.operands.iterator();
		boolean orResult = false;
		while (operandsIterator.hasNext()){
			Operation operand = operandsIterator.next();
			if (operand.result == true){
				orResult = true;
				break;
			}
		}
		this.setResultAndNotifyListeners(orResult);
	}
}
